package com.example.config;

import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;

import java.util.List;
import java.util.Map;

@Data
@Component
@ConfigurationProperties(prefix = "snowflakes")
public class SnowflakeProperties {
    // 可以使用Map来存储不同类型的服务器列表
    private Map<String, List<ServerConfig>> snowflakes;
    
    // 也可以直接定义具体的列表
    private List<ServerConfig> lists;

    @Data
    public static class ServerConfig {
        private String host;
        private Integer port;
        private Long workerId;
        private Long datacenterId;
    }
}